www.gusucode.com > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信 > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信关键技术,了解数字通信系统仿真流程,实现基本的信道编译码、调制解调等通信模块。(好评如潮,课设拿满) 学习并实现MIMO空时处理技术 学习性能分析的思路和方法/mimo/matlab for mimo 2x2/write_uint16_hex.m

    function write_int16_hex(name,A)
%
% write_int16_hex(name,A)
%
% Write elements of matrix A in .dat format, suitable for loading
% into Code Composer Studio.
%
% Elements are rounded to to 16-bit signed integer format
% and the values are stored in hex-format (little endian)

A=A(:).';
N=length(A);
if mod(N,2)
    A(end+1)=0; % hex format stores 32 bit words, zero-pad to even length
    N = N+1;
end

% convert to double and/or round to nearest integer
A=round(double(A));

if any(A>2^16-1 | A<0)
    error('One or more values are out of range')
end

% change order to compensate for endianess difference
A = [A(2:2:end); A(1:2:end)];

fid = fopen(name,'wt');
fprintf(fid,'1651 1 0 0 %X\n',N);
fprintf(fid,'0x%04X%04X\n',A);
fclose(fid);